#include "config_task.h"
TaskHandle_t configHandler;
//能够正常工作
extern QueueHandle_t configMsgHandle;
//用来去书写心跳任务需要的外设进行初始化
void init_config(){
config_eepprom_init();

}

void dispatchMsg(msg);
void config_task(void *param){
char *msg;
while (1)
{
    if(xQueueReceive(configMsgHandle,&msg,portMAX_DELAY)==pdTRUE){

dispatchMsg(msg);
    }




    vTaskDelay(2000);


}


}
void createconfigTask(){
xTaskCreate(config_task,"config_task",128,NULL,2,&configHandler);
}

void dispatchMsg(char *msg){
//获取消息类型
int type=parseMsgType(msg);
//根据消息类型做处理
switch (type)
{
case MSG_TYPE_CONFIG_TH:
    /* 调用处理阈值类配置的函数*/
    configTh(msg);

    break;
case MSG_TYPE_CONFIG_NETWORK:
    /* 调用处理网络类 */
configNetwork(msg);

    break;
default:
    break;
}

}